﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TaxModify.aspx.cs" Inherits="Admin.Tax.TaxModify" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>完税数据修改</title>
    <link href="/Admin/Css/rightbar.css?FileVersion=<%=FileVersion %>" rel="stylesheet"
        type="text/css" />
    <script src="/admin/Scripts/Calendar2008.js?FileVersion=<%=FileVersion %>" type="text/javascript"></script>
    <script src="/Admin/Scripts/jquery-1.4.1.min.js?FileVersion=<%=FileVersion %>" type="text/javascript"></script>
    <script src="/admin/Scripts/Check.js?FileVersion=<%=FileVersion %>" type="text/javascript"></script>
</head>
<body id="wallet">
    <div class="warp">
        <div class="topnav">
            <ul>
                <%if (HasPower("TaxList.aspx"))
                  { %>
                <li><a href="TaxList.aspx"><span>完税信息查询</span></a></li><%} %>
                <li><a href="javascript:void(0);" style="cursor: default;" class="on_nav"><span>补交完税记录</span></a></li>
            </ul>
        </div>
        <div class="tab mt15">
            <ul>
                <li class="in_on"><strong>补交完税记录</strong></li>
                <li class="caution01">带 <span class="org">*</span> 号为必填项目</li>
            </ul>
        </div>
        <div class="cont" style="padding-top: 8px;" id="stb8">
            <form id="form1" name="form1" action="TaxModify.aspx?action=modify" method="post">
            <input type="hidden" id="id" name="id" value="<%=id %>" />
            <table width="660" border="0" cellspacing="0" cellpadding="0" class="tb01">
                <tr>
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        <span class="org">*</span>房产证编号：
                    </td>
                    <td align="left" valign="top">
                        <input type="text" id="txtCertificateID" name="txtCertificateID" class="input200_out"
                            style="width: 240px;" value="<%=te.CertificateID %>" need="房产证编号必须输入" disabled="disabled" /><span
                                class="gray pl10">请输入房产证编号</span>
                    </td>
                </tr>
                <tr>
                    <td align="left" valign="middle" bgcolor="#F9F9F9" colspan="2" style="padding-left: 60px;">
                        <div id="divHouseInfo" style='padding-top: 5px; line-height: 150%; padding-left: 5px;
                            color: Red;'>
                            房主姓名：<span id="spanName"></span>，身份证号：<span id="spanIDCardNum"></span>，房产类型：<span
                                id="pHouseType"></span><br />
                            房产计税面积：<span id="pOriginalPrice"></span>，土地面积：<span id="pTudiArea"></span>,租金：<span
                                id="pRentPrice"><%=te.RentPrice %></span>
                        </div>
                        <input type="hidden" id="txtRentID" name="txtRentID" />
                    </td>
                </tr>
                <tr>
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        税款起止日期：
                    </td>
                    <td align="left" valign="top">
                        <input type="text" id="txtStartDate" name="txtStartDate" class="input200_out" style="width: 106px;"
                            maxlength="50" value="<% =FormatData<DateTime>(te.StartDate, "yyyy-MM-dd")%>"
                            date="税款起始日期格式错" />
                        -
                        <input type="text" id="txtEndDate" name="txtEndDate" class="input200_out" style="width: 106px;"
                            maxlength="50" value="<% =FormatData<DateTime>(te.EndDate, "yyyy-MM-dd")%>" date="税款终止日期格式错" />
                    </td>
                </tr>
                <tr>
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        税款属期与方式：
                    </td>
                    <td align="left" valign="middle">
                        <select id="selYear" name="selYear" style="width: 115px;">
                            <%=CreateYear(te.Year)%>
                        </select><span style="padding-left: 13px;"></span>
                        <select id="selType" name="selType" style="width: 115px;">
                            <option value="分税种录入" selected="selected">分税种录入</option>
                            <option value="租金收入">租金收入</option>
                        </select><span class="gray pl10">请选择税款属期和方式</span>
                    </td>
                </tr>
                <tr id="tr1">
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        是否完税：
                    </td>
                    <td align="left" valign="top">
                        <input type="radio" name="rdIsTaxOK" id="rdIsTaxOK0" value="0" checked="checked" /><label
                            for="rdIsTaxOK0">否</label>
                        <input type="radio" name="rdIsTaxOK" id="rdIsTaxOK1" value="1" /><label for="rdIsTaxOK1">是</label>
                        <span id="sComDate" style="padding-left: 10px; display: ''<%--<%= te.IsTaxOK == 1 ? "" : "none"%>--%>;">完税日期：<input type="text"
                            id="txtComDate" name="txtComDate" class="input200_out" style="width: 92px;" maxlength="50"
                            date="完税日期格式错" value="<% =FormatData<DateTime>(te.ComDate, "yyyy-MM-dd")%>" /></span>
                    </td>
                </tr>
                <tr id="trTotal">
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        税款总额：
                    </td>
                    <td align="left" valign="top">
                        <input type="text" id="txtTotalTax" name="txtTotalTax" class="input200_out" style="width: 240px;"
                            maxlength="50" float="税款总额必须位数字" value="<%= te.TotalTax %>" />
                    </td>
                </tr>
                <tr>
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        房产税：
                    </td>
                    <td align="left" valign="top">
                        <input type="text" id="txtFangchanTax" name="txtFangchanTax" class="input200_out"
                            style="width: 240px;" maxlength="50" float="房产税必须位数字" value="<%= te.FangchanTax %>" />
                    </td>
                </tr>
                <tr>
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        土地使用税：
                    </td>
                    <td align="left" valign="top">
                        <input type="text" id="txtTudiTax" name="txtTudiTax" class="input200_out" style="width: 240px;"
                            maxlength="50" float="土地使用税必须位数字" value="<%= te.TudiTax %>" />
                    </td>
                </tr>
                <tr name="hd">
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        营业税：
                    </td>
                    <td align="left" valign="top">
                        <input type="text" id="txtYingyeTax" name="txtYingyeTax" class="input200_out" style="width: 240px;"
                            maxlength="50" float="营业税必须位数字" value="<%= te.YingyeTax %>" />
                    </td>
                </tr>
                <tr name="hd">
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        个人所得税：
                    </td>
                    <td align="left" valign="top">
                        <input type="text" id="txtPersonalTax" name="txtPersonalTax" class="input200_out"
                            style="width: 240px;" maxlength="50" float="个人所得税必须位数字" value="<%= te.PersonalTax %>" />
                    </td>
                </tr>
                <tr name="hd">
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        城市维护建设税：
                    </td>
                    <td align="left" valign="top">
                        <input type="text" id="txtCityTax" name="txtCityTax" class="input200_out" style="width: 240px;"
                            maxlength="50" float="城市维护建设税必须位数字" value="<%= te.CityTax %>" />
                    </td>
                </tr>
                <tr name="hd">
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        教育费附加：
                    </td>
                    <td align="left" valign="top">
                        <input type="text" id="txtJiaoyuTax" name="txtJiaoyuTax" class="input200_out" style="width: 240px;"
                            maxlength="50" float="教育费附加必须位数字" value="<%= te.JiaoyuTax %>" />
                    </td>
                </tr>
                <tr name="hd">
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        地方教育附加：
                    </td>
                    <td align="left" valign="top">
                        <input type="text" id="txtDifangJiaoyuTax" name="txtDifangJiaoyuTax" class="input200_out"
                            style="width: 240px;" maxlength="50" float="地方教育附加必须位数字" value="<%= te.DifangJiaoyuTax %>" />
                    </td>
                </tr>
                <tr name="hd">
                    <td align="right" valign="middle" bgcolor="#F9F9F9">
                        印花税：
                    </td>
                    <td align="left" valign="top">
                        <input type="text" id="txtYinhuaTax" name="txtYinhuaTax" class="input200_out" style="width: 240px;"
                            maxlength="50" float="个人所得税必须位数字" value="<%= te.YinhuaTax %>" />
                    </td>
                </tr>
            </table>
            </form>
        </div>
        <div class="btudiv">
            <ul style="width: 180px;">
                <li>
                    <input name="Submit1" type="submit" id="Submit1" class="button_sure" onclick="return CheckForm()"
                        value="确认修改" /></li>
            </ul>
        </div>
    </div>
    <script type="text/javascript">
        var c = new Calendar("c");
        c.offsetTop = 30;
        document.write(c);

        $(function () {
            //为日期输入框增加日历控件
            $(":input[date]").bind("focus", function (event) {
                c.showMoreDay = false;
                c.show(this); this.
                className = 'input60_on';
                this.onmouseout = ''
            });
        });


        //初始化
        jQuery(function ($) {
            ShowInputType("分税种录入");
            $("#selType").change(function () {
                ShowInputType($("#selType").val());
            });
            /*
            $("#rdIsTaxOK0").click(function () {
                $("#sComDate").css("display", "none");
                $("#txtComDate").val("")
            });
            $("#rdIsTaxOK1").click(function () {
                $("#sComDate").css("display", "");
            });
            */
            GetHouseInfo();
            $("#selType").val('<%= te.TaxInputType %>');
            $(":radio[name='rdIsTaxOK']").each(function (i) {
                if (this.value == '<%=te.IsTaxOK %>') {
                    this.checked = true;
                }
            });
            ShowInputType('<%= te.TaxInputType %>');
        });
        //获取房屋信息
        function GetHouseInfo() {
            var certificateID = $("#txtCertificateID").val();
            if (certificateID == "") {
                return;
            }
            var url = "/Admin/AjaxPage/HouseInfo.aspx?action=gethousedetail&CertificateID=" + certificateID + "&year=" + $("#selYear").val() + "&timestamp=" + (new Date()).getTime();
            $.ajax({
                url: url,
                dataType: "json",
                success: function (data) {
                    if (data == "") {
                        $("#divHouseInfo").css("display", "none");
                        alert("房产证编号不存请先录入房产信息，再添加完税信息");
                        $("#Submit1").attr("disabled", true);
                    }
                    else {
                        $("#txtRentID").val(data[0].RentID);
                        $("#spanName").html(data[0].Name);
                        $("#spanIDCardNum").html(data[0].IDCardNum);
                        $("#pOriginalPrice").html(data[0].OriginalPrice);
                        $("#pTudiArea").html(data[0].TudiArea);
                        $("#pHouseType").html(data[0].HouseType);
                        //$("#pRentPrice").html(data[0].RentPrice);
                        $("#divHouseInfo").css("display", "");
                        $("#Submit1").attr("disabled", false);
                        ShowTaxType(data[0].HouseType);
                    }
                },
                error: function (data) {
                    //alert("验证房屋信息失败，请刷新页面重试!");
                }
            });
        }

        function ShowInputType(type) {
            if (type == "分税种录入") {
                $("#trTotal").css("display", "none");
            }
            else {
                $("#trTotal").css("display", "");
            }
        }

        function ShowTaxType(houseType) {
            if (houseType == "出租") {
                $("tr[name='hd']").css("display", "");
            }
            else {
                $("tr[name='hd']").css("display", "none");
            }
        }
    </script>
    <script type="text/javascript">
        function CheckForm() {
            var obj = document.form1.elements;
            if (!checkAttr(obj)) {
                return false;
            }
            $("#form1").submit();
            return true;
        }
    </script>
</body>
</html>
